package com.coda.controller;

import com.coda.common.Result;
import com.coda.entity.Statistics;
import com.coda.service.StatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/warehouse/statistics")
@Api(tags = "统计相关接口")
public class StatisticsController {

    @Autowired
    private StatisticsService statisticsService;
    /**
     * 统计各商品数量
     * @return
     */
    @GetMapping("/store-invent")
    @ApiOperation("统计各仓库商品数量")
    public Result getStoreInvent(){
        List<Statistics> statisticsList = statisticsService.getStoreInvent();
        return Result.ok(statisticsList);
    }
}
